<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<script type="text/javascript">
function confirmation() {
	var answer = confirm("Do you want to delete this product")
	if (answer){
		return true;
	}
	else{
		return false;
	}
}
</script>
<div id="rightContent">
		<c:if test="${!empty listcategory}">
			<c:forEach items="${listcategory }" var="category">
				<li><a href="manage-shop-pro.html?id=${category.id}">${category.name}</a></li>
			</c:forEach>
		</c:if>
	<a href="addproduct.html" class="btn btn-primary btn-lg active"
		role="button">Import New Product !!!</a>
	<h2>${categoryname}</h2>
	<h3>New Products</h3>
	<table class="table table-hover">
		<tr>
			<th>#</th>
			<th>Product</th>
			<th>Name</th>
			<th>Price</th>
			<th>Date</th>
			<th>Quantity</th>
			<th>Action</th>
		</tr>

		<c:if test="${!empty newproducts}">
			<c:forEach items="${newproducts }" var="product" varStatus="status">
				<tr>
					<td><c:out value="${status.count}." /></td>
					<td><img width="50" src="${product.picture}" alt="" /></td>
					<td>${product.name }</td>
					<td>${product.price }</td>
					<td>${product.stringDate }</td>
					<td>${product.quantity }</td>
					<td><a href="updateproduct?id=${product.id}"><img
							src="/shopping-mall/resources/images/shop/admin/edit.png" title="Edit"></a>&nbsp;&nbsp;&nbsp;
						<a href="delproduct?id=${product.id}"><img
							src="/shopping-mall/resources/images/shop/admin/del.png" title="Delete" onclick="return confirmation()"></a></td>
				</tr>
			</c:forEach>

		</c:if>
	</table>
	<h3>Feature Products</h3>
	<table class="table table-hover">
		<tr>
			<th>#</th>
			<th>Product</th>
			<th>Name</th>
			<th>Price</th>
			<th>Date</th>
			<th>Quantity</th>
			<th>Action</th>
		</tr>
		<c:if test="${!empty featureproducts}">
			<c:forEach items="${featureproducts }" var="product"
				varStatus="status">
				<tr>
					<td><c:out value="${status.count}." /></td>
					<td><img width="50" src="${product.picture}" alt="" /></td>
					<td>${product.name }</td>
					<td>${product.price }</td>
					<td>${product.date }</td>
					<td>${product.quantity }</td>
					<td><a href="updateproduct?id=${product.id}"><img
							src="/shopping-mall/resources/images/shop/admin/edit.png" title="Edit"></a>&nbsp;&nbsp;&nbsp;
						<a href="delproduct?id=${product.id}"><img
							src="/shopping-mall/resources/images/shop/admin/del.png" title="Delete" onclick="return confirmation()"></a></td>
				</tr>
			</c:forEach>
		</c:if>
	</table>
</div>

